#ifndef ZIGBUSGATEWAY_H
#define ZIGBUSGATEWAY_H

#include <QObject>
#include <QThread>

#include <QDebug>
#include <QextLogger.h>
#include <IOStreamLogger.h>
#include <FileLogger.h>


#include <ZxPLService.h>
#include <ZigbusMessage.h>
#include <UsbZigbusConnection.h>
#include <UDPZigbusConnection.h>
#include <ModuleMessageHandler.h>


class Gateway : public QObject
{
    Q_OBJECT
    QThread xPLThread;
    QThread zigbusThread;

private:
    AbstractZigbusConnection* zigbusConnection;
    ModuleMessageHandler* translator;
    ZxPLService* xplService;

    IOStreamLogger* iostreamLogger;
    FileLogger* fileLogger;

public:
    explicit Gateway(QObject* parent = 0);
    virtual ~Gateway();
    void initializeZigbusConnection();
    void initializexPLService();
    void init();

public slots:
    void onConfigMediaZUdp(int, bool);
    void onConfigZMediaRS232(QString,QString,QString,QString,QString,QString, bool);

signals:
    void start_xPLService(bool);
    void stop_xPLService();

    void start_zigbusService();
    void stop_zigbusService();
};

#endif // ZIGBUSGATEWAY_H
